#ifndef OLIVE_H
#define OLIVE_H

#include "Sprite.h"
#include "FrameRangeAnimation.h"
#include "FrameRangeAnimator.h"
#include "Animation.h"
#include "Animator.h"
#include "TickAnimation.h"
#include "TimerTickAnimator.h"

class Olive : public Sprite	{
private:
	FrameRangeAnimation *walkAnimation, *dropAnimation;
	FrameRangeAnimator *walkAnimator, *dropAnimator;
	int orientation;
	bool recentlyDropped;
	int droppedHearts;
	static void DropCompleted(Animator *animator, void *closure);
	static void StopWalking(Animator *animator, void *closure);
	bool CollidesWithLeftBorder(int dx);
	bool CollidesWithRightBorder(int dx);
public:
	Olive::Olive(Dim _x, Dim _y, AnimationFilm* film,
		FrameRangeAnimation *_walkAnimation, FrameRangeAnimator *_walkAnimator,
		FrameRangeAnimation *_punchAnimation, FrameRangeAnimator *_punchAnimator);
	~Olive(void);
	static void GenerateNextMove(void *closure);
	void MoveHorizontal(int dx);
	void StopMoving(void);
	void DropHeart(void);
	bool canDropHeart(void);
	void ChangeOrientation(void);
	virtual void Move(int dx, int dy);
	virtual void ResetToDefaultFilm(void) {};
};

#endif